Repository navigation
fix(fleet/dispatch-test): mark dispatched only after the dispatch succeeds (#6598) - #6721
Merged
Merged
Conversation
…ceeds Issue #6598: verb_submit UPDATEed the job row to status=dispatched before fetching default_branch and POSTing the workflow dispatch, so every failure in that window (422 no workflow_dispatch trigger, 404, transport error) left a permanently lying row that status reported as dispatched forever. Split the write: record target_repo with the row still queued, dispatch, and only then mark dispatched. The three steps run through a small run_dispatch_sequence helper so unit tests pin the contract: order is target -> dispatch -> mark, a dispatch failure never reaches the mark step, and a target-write failure stops before dispatch. The no-eligible-scope behaviour (row remains queued) is unchanged; a failed dispatch now lands in that same truthful, retryable state. fleet-dispatch-test 16/16 tests pass; cargo check -p fleet passes.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 23 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes issue #6598:
fleet dispatch-test submitmarked the job rowdispatchedbefore the dispatch call, so any failure in that window — a workflow without theworkflow_dispatchtrigger (422), a missing workflow file (404), a repo body with nodefault_branch, a transport error — left a permanently lying row:statusreporteddispatchedforever for a job whose workflow never started, indistinguishable from a real in-flight job.Change (one file:
pkgs/fleet/crates/fleet-dispatch-test/src/lib.rs)The submit tail is split into three steps, run in order through a small
run_dispatch_sequencehelper:UPDATE jobs SET target_repo = ?, updated_at = ?with the status leftqueued(recording the chosen execution home is truthful at this point);default_branch, then POST the workflow dispatch;UPDATE jobs SET status = 'dispatched'only after the dispatch succeeds.Any step failing stops the sequence and propagates the error, so a failed dispatch leaves the row
queuedwith its target recorded — the same truthful, retryable state as the existing no-eligible-scope outcome, whose behaviour is unchanged. The submit usage text now describes the truthful order.Verification
cargo test -p fleet-dispatch-teston the laptop: 16/16 pass, including three new regression tests that pin the contract at the exact seamverb_submitcalls:cargo check -p fleet(the consuming binary crate) passes.dispatched, no corrective write) and lane code-k's fresh read ofverb_submiton current main during triage.Fixes #6598.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.